Field
One or more example embodiments relate to a method and system for enhancing a loading speed of an intermediate language file.
Description of Related Art
An intermediate language or InterLanguage (IL) may indicate a language used as an intermediate stage when translating a source language program with a complier and making the source language program into a target language program. For example, if a high level language program is made into a machine language program by converting the high level language program to an assembly language and by assembling the converted assembly language to generate the machine language, the assembly language is an example of an intermediate language.
At least some related art relates to an apparatus and method for converting an intermediate language of a mobile platform, and discloses a C/C++ compiler configured to convert a mobile platform source code developed with C or C++ language to an intermediate language code required at an interpreter of a mobile communication terminal and an intermediate language assembler configured to convert the intermediate language code to a format executed at the interpreter of the mobile communication terminal.
A code of an application that goes through conversion to the intermediate language may be vulnerable to decompiling due to a characteristic of the code. For example, a code of an application created with a programming language such as JAVA goes through conversion to the intermediate language due to its characteristic and is vulnerable to decompiling. Thus, an important code may be easily exposed and manipulated. In detail, a code created with JAVA is generally compiled to a file with extension “.class” for each class and, in ANDROID, codes created with JAVA are compiled based on a dex file that includes a header and data, for example, ‘classes.dex’. Here, the dex file is a bytecode that is a binary code as an intermediate language code in which a JAVA code is compiled. The bytecode is a compiled form of a JAVA program. Once the JAVA program is converted to the bytecode, the bytecode may be transmitted over a network and may be executed at a virtual machine.
For example, files compiled in a form of an intermediate language code may be provided from a server to an electronic device. The electronic device may execute the files compiled in the form of the intermediate language code using a supported virtual machine. Accordingly, the electronic device may acquire and correct an original code by decompiling the compiled files based on a characteristic of the intermediate language and may compile the corrected code to a form of the intermediate language code again. In this aspect, an application may be forged.
To address the above issue, in the related art, an obfuscation technique, an encryption technique, etc., may be applied to an intermediate language file, such as a dex file, in order to protect the intermediate language file.
Meanwhile, a virtual machine is configured to create an optimization file associated with an intermediate language file based on a type of the virtual machine, and to load and process the optimization file. For example, a virtual machine of an ART mode of ANDROID translates all of intermediate languages included in an application in response to installation of the application, creates the optimization file, for example, an odex file or an oat file, in advance, and executes the application using the optimization file.
However, due to the forgery issue of the application, a system that executes the application may not continuously use the created optimization file. For example, due to a code protection and the like, the system needs to delete the optimization file, to decrypt an obfuscated or encrypted file associated with an intermediate language file every time an application is executed, and to create a new optimization file every time the application is executed. In this case, a relatively large amount of time is used to create and load the optimization file.